<!--
 * @FilePath     : /study_code/html/input-type-file-attr.html
 * @Description  : input type="file" attr
 * @Date         : 2025-04-26 08:17:48
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-26 08:30:40
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
  </head>

  <body>
    <h2>属性 required</h2>
    <form action="https://www.baidu.com" method="GET">
      <input type="file" required />
      <button>提交</button>
    </form>

    <hr />

    <h2>属性 accept</h2>
    <form action="https://www.baidu.com" method="GET">
      <!-- 使用1：表示可选择所有图片类型，和 pdf文件 -->
      <input type="file" accept="image/*,.pdf" />
      <!-- 使用2：用以识别 Microsoft Word文件 -->
      <input
        type="file"
        id="docpicker"
        accept=".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
      />
    </form>

    <!-- capture -->
    <hr />

    <h2>属性 multiple</h2>
    <form action="https://www.baidu.com" method="GET">
      <input type="file" accept="image/*,.pdf" multiple />
    </form>
  </body>
</html>
